package com.hjm.system.controller.cuser;


import com.hjm.common.core.controller.BaseController;
import com.hjm.common.core.domain.Result;
import com.hjm.common.core.domain.page.TableDataInfo;
import com.hjm.system.domain.cuser.dto.UserDTO;
import com.hjm.system.domain.cuser.dto.UserQueryDTO;
import com.hjm.system.service.cuser.UserService;
import com.hjm.system.service.cuser.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController extends BaseController {

    @Autowired
    private UserServiceImpl userService;

    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO) {
        return getTableData(userService.list(userQueryDTO));
    }



    @PutMapping("/block")
    // todo 拉黑（限制功能），解除拉黑
    public Result<Void> block(UserDTO userDTO){
        return toResult(userService.block(userDTO));
    }

}
